/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.entidade.empresa;

import br.com.deployment.entidade.humana.Titular;
import br.com.deployment.entidade.humana.Titular;
import br.com.deployment.entidade.localidade.Endereco;
import br.com.deployment.entidade.registroimovel.GeoRef;
import java.io.Serializable;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author gylvanne
 */
@Entity
public class Cartorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @SequenceGenerator(name = "seq_cartorio", sequenceName = "seq_cartorio",allocationSize = 1)
    @GeneratedValue(generator = "seq_cartorio", strategy = GenerationType.SEQUENCE)
    private Integer id;
    @Column(length=60)
    private String nome;
    @Column(length=60)    
    private String fantasia;
    @OneToOne(cascade= CascadeType.ALL ,fetch= FetchType.EAGER)
    private Titular titular;
    @OneToOne(cascade= CascadeType.ALL , fetch= FetchType.EAGER)
    private Endereco endereco;
    @Column(length=13)        
    private String fax;
    @Column(length=60)    
    private String email;
    @Column(length=60)    
    private String site;
    @OneToMany(cascade= CascadeType.ALL , fetch= FetchType.EAGER)
    private List<GeoRef> geoAtuacao;
    
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public List<GeoRef> getGeoAtuacao() {
        return geoAtuacao;
    }

    public void setGeoAtuacao(List<GeoRef> geoAtuacao) {
        this.geoAtuacao = geoAtuacao;
    }

    
    
   
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Endereco getEndereco() {
        return endereco;
    }

    public void setEndereco(Endereco endereco) {
        this.endereco = endereco;
    }

  

    public String getFantasia() {
        return fantasia;
    }

    public void setFantasia(String fantasia) {
        this.fantasia = fantasia;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    public Titular getTitular() {
        return titular;
    }

    public void setTitular(Titular titular) {
        this.titular = titular;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Cartorio other = (Cartorio) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.nome == null) ? (other.nome != null) : !this.nome.equals(other.nome)) {
            return false;
        }
        if ((this.fantasia == null) ? (other.fantasia != null) : !this.fantasia.equals(other.fantasia)) {
            return false;
        }
        if (this.titular != other.titular && (this.titular == null || !this.titular.equals(other.titular))) {
            return false;
        }
        if (this.endereco != other.endereco && (this.endereco == null || !this.endereco.equals(other.endereco))) {
            return false;
        }
        if ((this.fax == null) ? (other.fax != null) : !this.fax.equals(other.fax)) {
            return false;
        }
        if ((this.email == null) ? (other.email != null) : !this.email.equals(other.email)) {
            return false;
        }
        if ((this.site == null) ? (other.site != null) : !this.site.equals(other.site)) {
            return false;
        }
        if (this.geoAtuacao != other.geoAtuacao && (this.geoAtuacao == null || !this.geoAtuacao.equals(other.geoAtuacao))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 13 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 13 * hash + (this.nome != null ? this.nome.hashCode() : 0);
        hash = 13 * hash + (this.fantasia != null ? this.fantasia.hashCode() : 0);
        hash = 13 * hash + (this.titular != null ? this.titular.hashCode() : 0);
        hash = 13 * hash + (this.endereco != null ? this.endereco.hashCode() : 0);
        hash = 13 * hash + (this.fax != null ? this.fax.hashCode() : 0);
        hash = 13 * hash + (this.email != null ? this.email.hashCode() : 0);
        hash = 13 * hash + (this.site != null ? this.site.hashCode() : 0);
        hash = 13 * hash + (this.geoAtuacao != null ? this.geoAtuacao.hashCode() : 0);
        return hash;
    }

    
   
   

    @Override
    public String toString() {
        return "Cartorio{" + "nome=" + nome + ", fantasia=" + fantasia + ", titular=" + titular + ", endereco=" + endereco + ", fax=" + fax + ", email=" + email + ", site=" + site + '}';
    }

   
    
}
